/**
 * Bakalarska prace - Inteligentni budik
 * @package sleepCatcher
 * @file FormAlarmDelete.h
 * @author Jan Pesava - xpesav00
 * @email xpesav00@stud.fit.vutbr.cz
 * @date 24. 12. 2011
 */

#ifndef FORMALARMSDELETE_H_
#define FORMALARMSDELETE_H_

#include <FBase.h>
#include <FUi.h>
#include <FGrpRectangle.h>

using namespace Osp::Ui::Controls;
using namespace Osp::Graphics;
using namespace Osp::Base;
using namespace Osp::Base::Collection;

class FormAlarmDelete :
	public Osp::Ui::Controls::Form,
	public Osp::Ui::IActionEventListener,
	public Osp::Ui::Controls::IListViewItemEventListener,
	public Osp::Ui::Controls::IListViewItemProvider
{

// Construction
public:
	FormAlarmDelete();
	virtual ~FormAlarmDelete();

// Constants
public:
	static const RequestId IDA_ALARM_REMOVE = 200;
	static const RequestId IDA_ALARM_BACK 	= 201;
	static const int LIST_ITEM_NAME 		= 202;
	static const int LIST_ITEM_TIME			= 203;
	static const int LIST_ITEM_REPEAT		= 204;

//Attributes
private:
	ListView* pListView;
	ArrayList* pAlarmsList;

// Methods
public:
	bool Initialize(void);
	virtual result OnInitializing(void);
	virtual result OnTerminating(void);
	virtual void OnActionPerformed(const Osp::Ui::Control& source, int actionId);
	virtual void OnItemStateChanged (const Osp::Ui::Control &source, int index, int itemId, Osp::Ui::ItemStatus status);
	virtual void OnListViewContextItemStateChanged (Osp::Ui::Controls::ListView &listView, int index, int elementId, Osp::Ui::Controls::ListContextItemStatus status);
	virtual void OnListViewItemLongPressed (Osp::Ui::Controls::ListView &listView, int index, int elementId, bool &invokeListViewItemCallback);
	virtual void OnListViewItemStateChanged (Osp::Ui::Controls::ListView &listView, int index, int elementId, Osp::Ui::Controls::ListItemStatus status);
	virtual void OnListViewItemSwept (Osp::Ui::Controls::ListView &listView, int index, Osp::Ui::Controls::SweepDirection direction);
	virtual Osp::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
	virtual bool DeleteItem(int index, Osp::Ui::Controls::ListItemBase* pItem, int itemWidth);
	virtual int GetItemCount(void);
	void LoadAlarmList();
	void Update();
	void Redraw();
	void DeleteAlarms();
	int GetFormId();
	virtual result OnDraw();
};

#endif /* FORMALARMSDELETE_H_ */
